define(["jQuery", "kendo"], function ($, kendo) {
    return {
    	// creationMode:false,
		// isGrid: 0,
		// heightGrid : 0,
		// widthGrid : 0,
		// isDashed : 0,
		show : function(){ 
			$( "#unlock-dragable-menu" ).show();	 
		},
		
        init: function (e) {
			console.log("init property ...");
			$("#unlock-dragable-menu").draggable({cancel:"#text-box-password-unlock"});
			$("#unlock-dragable-menu").hide(); 
			$('#text-box-password-unlock').click(function () {    
				$(this).focus();
			});
			 
			
			$(".ok-unlock-button").click(function() {
				$( "#unlock-dragable-menu" ).hide(); 
				
				if($('#text-box-password-unlock').val() == ""){
					alert(App.localize("%no_password_warning"));
				}else{
					if(App.passVal == $('#text-box-password-unlock').val()){
						App.socket.emit('cm_unlock', {roomid: App.fileId, pageid:App.pageId,objectId: App.activeObject.attr('id'), id: App.userId,type:App.activeObject.attr('object_type'), status:0, userName: App.activeObject.attr('created_by'), dateCreate: App.activeObject.attr('created_date'), password:$('#text-box-password-lock').val(), without_pass:App.withoutPass}); 
						
						App.activateLockedObject(App.activeObject.attr('id'));
					
					}else{
						alert(App.localize("%password_nomatch_warning"));
					}
					
				}
				
			});
			
			$(".cancel-unlock-button").click(function() {
				var r=confirm(App.localize("%cancel_confirmation"));
				if (r==true)
				{
					$( "#unlock-dragable-menu" ).hide(); 
				}
				else
				{
					console.log("You pressed Cancel!");
				}
			});	
			 

			 
		
		}
	}
});